/*
 *	WARN  :  THIS BACKEND CODE IS AUTO GENERATE, ALL RIGHTS RESERVED.
 *	AUTHOR:  ZhaoChunPing
 *	EMAIL :  forxy@126.com
 *	DATE  :  2022.1
 */

#ifndef PCKS11_INNERF_H
#define PCKS11_INNERF_H

#include <stdint.h>
#include "pkcs11.h"

CK_RV	C_LoginUser_inner
(
	void *ctx,
	CK_USER_TYPE userType,
	CK_UTF8CHAR_PTR pPin,
	CK_ULONG ulPinLen,
	CK_UTF8CHAR_PTR pUsername,
	CK_ULONG ulUsernameLen
);

CK_RV	C_Logout_inner
(
	void *ctx
);

CK_RV	C_EncryptInit_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_OBJECT_HANDLE hKey
);

CK_RV	C_EncryptUpdate_inner
(
	void *ctx,
	CK_BYTE_PTR pPart,
	CK_ULONG ulPartLen,
	CK_BYTE_PTR pEncryptedPart,
	CK_ULONG_PTR pulEncryptedPartLen
);

CK_RV	C_EncryptFinal_inner
(
	void *ctx,
	CK_BYTE_PTR pLastEncryptedPart,
	CK_ULONG_PTR pulLastEncryptedPartLen
);

CK_RV	C_Encrypt_inner
(
	void *ctx,
	CK_BYTE_PTR pData,
	CK_ULONG ulDataLen,
	CK_BYTE_PTR pEncryptedData,
	CK_ULONG_PTR pulEncryptedDataLen
);

CK_RV	C_DecryptInit_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_OBJECT_HANDLE hKey
);

CK_RV	C_DecryptUpdate_inner
(
	void *ctx,
	CK_BYTE_PTR pEncryptedPart,
	CK_ULONG ulEncryptedPartLen,
	CK_BYTE_PTR pPart,
	CK_ULONG_PTR pulPartLen
);

CK_RV	C_DecryptFinal_inner
(
	void *ctx,
	CK_BYTE_PTR pLastPart,
	CK_ULONG_PTR pulLastPartLen
);

CK_RV	C_Decrypt_inner
(
	void *ctx,
	CK_BYTE_PTR pEncryptedData,
	CK_ULONG ulEncryptedDataLen,
	CK_BYTE_PTR pData,
	CK_ULONG_PTR pulDataLen
);

CK_RV	C_DigestInit_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism
);

CK_RV	C_DigestUpdate_inner
(
	void *ctx,
	CK_BYTE_PTR pPart,
	CK_ULONG ulPartLen
);

CK_RV	C_DigestFinal_inner
(
	void *ctx,
	CK_BYTE_PTR pDigest,
	CK_ULONG_PTR pulDigestLen
);

CK_RV	C_Digest_inner
(
	void *ctx,
	CK_BYTE_PTR pData,
	CK_ULONG ulDataLen,
	CK_BYTE_PTR pDigest,
	CK_ULONG_PTR pulDigestLen
);

CK_RV	C_Sign_inner
(
	void *ctx,
	CK_BYTE_PTR pData,
	CK_ULONG ulDataLen,
	CK_BYTE_PTR pSignature,
	CK_ULONG_PTR pulSignatureLen
);

CK_RV	C_Verify_inner
(
	void *ctx,
	CK_BYTE_PTR pData,
	CK_ULONG ulDataLen,
	CK_BYTE_PTR pSignature,
	CK_ULONG ulSignatureLen
);

CK_RV	C_GenerateRandom_inner
(
	void *ctx,
	CK_BYTE_PTR pRandomData,
	CK_ULONG ulRandomLen
);

CK_RV	C_GenerateKey_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulCount,
	CK_OBJECT_HANDLE_PTR phKey
);

CK_RV	C_GenerateKeyPair_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_ATTRIBUTE_PTR pPublicKeyTemplate,
	CK_ULONG ulPublicKeyAttributeCount,
	CK_ATTRIBUTE_PTR pPrivateKeyTemplate,
	CK_ULONG ulPrivateKeyAttributeCount,
	CK_OBJECT_HANDLE_PTR phPublicKey,
	CK_OBJECT_HANDLE_PTR phPrivateKey
);

CK_RV	C_CreateObject_inner
(
	void *ctx,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulCount,
	CK_OBJECT_HANDLE_PTR phObject
);

CK_RV	C_DestroyObject_inner
(
	void *ctx,
	CK_OBJECT_HANDLE hObject
);

CK_RV	C_FindObjectsInit_inner
(
	void *ctx,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulCount
);

CK_RV	C_FindObjects_inner
(
	void *ctx,
	CK_ULONG ulMaxObjectCount,
	CK_OBJECT_HANDLE_PTR phObject,
	CK_ULONG_PTR pulObjectCount
);

CK_RV	C_FindObjectsFinal_inner
(
	void *ctx
);

CK_RV	C_GetAttributeValue_inner
(
	void *ctx,
	CK_OBJECT_HANDLE hObject,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulCount
);

CK_RV	C_SetAttributeValue_inner
(
	void *ctx,
	CK_OBJECT_HANDLE hObject,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulCount
);

CK_RV	C_WrapKey_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_OBJECT_HANDLE hWrappingKey,
	CK_OBJECT_HANDLE hKey,
	CK_BYTE_PTR pWrappedKey,
	CK_ULONG_PTR pulWrappedKeyLen
);

CK_RV	C_UnwrapKey_inner
(
	void *ctx,
	CK_MECHANISM_PTR pMechanism,
	CK_OBJECT_HANDLE hUnwrappingKey,
	CK_BYTE_PTR pWrappedKey,
	CK_ULONG ulWrappedKeyLen,
	CK_ATTRIBUTE_PTR pTemplate,
	CK_ULONG ulAttributeCount,
	CK_OBJECT_HANDLE_PTR phKey
);

#endif
